10 REM    BINARY STAR ORBIT
12 REM
14 P1=4*ATN(1): R1=180/P1
16 C=2*P1: A1=0.0000005
18 REM
20 INPUT "SEMIMAJOR AXIS";A
22 INPUT "ECCENTRICITY  ";E0
24 IF INT(E0)=0 THEN 30
26 PRINT "NOT VALID; REENTER"
28 GOTO 22
30 INPUT "EPOCH OF PERIASTRON";T
32 INPUT "PERIOD IN YEARS    ";P
34 INPUT "INCLINATION        ";I
36 INPUT "ARG OF PERIASTRON  ";W
38 INPUT "P.A. OF ASC NODE   ";L
40 I=I/R1: W=W/R1: L=L/R1
42 REM
44 INPUT "DATE OF OBS (YR)  ";D
46 T1=D-T: M=C*T1/P
48 E=M+E0*SIN(M)+E0*E0*SIN(2*M)/2
50 N=E-E0*SIN(E): G=M-N
52 F=G/(1-E0*COS(E)): E=E+F
54 IF ABS(G)>A1 THEN 50
56 U=(1+E0)/(1-E0): H=COS(E/2)
58 IF H=0 THEN V=P1: GOTO 62
60 V=2*ATN(SQR(U)*SIN(E/2)/H)
62 K=V+W: Y=SIN(K)*COS(I)
64 X=COS(K): Q=ATN(Y/X)
66 IF X<0 THEN Q=Q+P1
68 IF X<0 THEN 72
70 IF Y<0 THEN Q=Q+C
72 P2=Q+L: IF P2>C THEN P2=P2-C
74 R=A-A*E0*COS(E)
76 S=R*X/COS(Q)
78 P3=INT(P2*R1*10+0.5)/10
80 S3=INT(S*100+0.5)/100
82 PRINT "P.A. ";P3;" DEG"
84 PRINT "SEP. ";S3;" ARC SEC"
86 PRINT
88 INPUT "ANOTHER (Y OR N)";Q$
90 IF Q$<>"N" THEN 44
92 REM  ========================
94 REM  FROM "ASTRONOMICAL
96 REM  COMPUTING," SKY & TELE-
98 REM  SCOPE, JULY, 1987
100 REM ========================
102 END
